
GXX = g++

# library dependency
LIBS = -lBulletCollision -lBulletDynamics -lLinearMath -lOpenThreads -losg -losgDB -losgFX -losgGA -losgSim -losgUtil -losgViewer 

# directory containing .h files
INC1  = /usr/local/include
INC2  = Extras

# directory containing output files
OUT   = lib/unix

# directory containing library files
LIB1  = /usr/local/lib
LIB2  = lib/unix

# the program(s) we're writing
PROGS = PhyCompare 

# version of the libraries
VERSION = 1.0

all: ${PROGS}

WavefrontRead:
	${GXX} -c Extras/*.cpp
	ar -cvq ${OUT}/libWavefrontRead.a *.o
	mv *.o ${OUT}

PhyModel: 
	${GXX} -c -I${INC1} -I${INC2} src/PHYModeler.cpp src/PHYFactory.cpp src/PHYCollisionObjects.cpp 
	ar -cvq ${OUT}/libPhyModel.a *.o
	mv *.o ${OUT}

#	${GXX} -shared -I${INC} -L${LIB} ${LIBS} -Wl,-soname,libPhyModel.so.${VERSION} PHYModeler.cpp PHYFactory.cpp PHYCollisionObjects.cpp -o libPhyModel.so.${VERSION} 
#	ln -sf libPhyModel.so.${VERSION} libPhyModel.so
#	ln -sf libPhyModel.so.${VERSION} libPhyModel.so.1
	
PhyView: 
	${GXX} -c src/PHYView.cpp 
	ar -cvq ${OUT}/libPhyView.a *.o
	mv *.o ${OUT}

#	${GXX} -shared -I${INC} -L${LIB}  ${LIBS} -lPhyModel  -Wl,-soname,libPhyView.so.${VERSION} PHYView.cpp -o libPhyView.so.${VERSION} 
#	ln -sf libPhyView.so.${VERSION} libPhyView.so
#	ln -sf libPhyView.so.${VERSION} libPhyView.so.1

PhyCompare: WavefrontRead PhyModel PhyView
	${GXX} -I${INC1} -I${INC2} -L${LIB1} -L${LIB2} ${LIBS} -lPhyView src/main.cpp -o ${OUT}/phycompare.out
	
PhyCompareAll:
	${GXX} -I${INC1} -I${INC2} -L${LIB1} -L${LIB2} ${LIBS} Extras/*.cpp src/*.cpp -o ${OUT}/phycompare.out

	
clean:
	rm -f ${OUT}/*.o* ${OUT}/*.out ${OUT}/*.a

